<?php
	$user = $this->controller->getUser();
	
	$vote_info = $this->layout()->vote_info;
	$vote_list = array();
	foreach($vote_info as $thread_id=>$thread){
		$now = time();
		foreach($thread as $phase_id=> $phase){
			if($phase->view_enable==1){
				$vname = $phase->thread_name;
				$vid = $thread_id."_".$phase_id;
				$vote_list[] = array("name"=>$vname, "votephoto_category"=>$phase->votephoto_category, "vid"=>$vid, "thid"=>$thread_id, "pid"=>$phase_id);
			}
		}
		
	}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><?echo ($this->layout()->title!="" ? $this->escape($this->layout()->title) : "") ?></title>
	
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta name="generator" content="">
	<link rel="SHORTCUT ICON" href="<?php echo EVENT_STATIC_SERVER;?>/images/favicon.ico"/>
	<script type="text/javascript">

		var fadeimages=new Array()
		<?php 
		$totalImg = 19;
		for($i=0; $i<$totalImg; $i++){
		?>
		fadeimages[<?php echo $i;?>]=["<?php echo $this->layout()->spath;?>/slide/<?php echo str_pad($i+1, 3, '0', STR_PAD_LEFT);?>.jpg", "", ""]
		<?php
		}
		?>
	</script>
    <!--Import CSS files:-->
    <link href="<?php echo $this->layout()->spath; ?>/css/style_all.css" rel="stylesheet" type="text/css" /> 
    <!--End css files-->
    <script type="text/javascript" src="<?php echo EVENT_STATIC_SERVER;?>/js/swfobject.js"></script>
    <script type="text/javascript" src="<?php echo EVENT_STATIC_SERVER;?>/js/jquery.js"></script>
    <script type="text/javascript" src="<?php echo EVENT_STATIC_SERVER;?>/js/event_cover_comment.js"></script>
    <script type="text/javascript" src="<?php echo EVENT_STATIC_SERVER;?>/js/fadeimage.js"></script>

   <!--[if lt IE 7]>
        <script defer type="text/javascript" src="<?php echo EVENT_STATIC_SERVER;?>/js/pngfix.js"></script>
        <link href="<?php echo EVENT_STATIC_SERVER;?>/css/ie6fix.css" rel="stylesheet" type="text/css" />
    <![endif]-->        


</head>
<body>
<div id="container">
	<!--Menu tamtay:-->
    <div id="ttbar" class="page-center">
    	<div class="ttmenu">
        	<a href="http://www.tamtay.vn">Tamtay.vn</a> | 
            <a href="http://www.tamtay.vn/video">Video</a> | 
            <a href="http://www.tamtay.vn/image">Ảnh</a> | 
            <a href="http://www.tamtay.vn/music">Nhạc</a> | 
            <a href="http://blog.tamtay.vn">Blog</a> | 
            <a href="http://www.tamtay.vn/event/browse">Sự kiện</a> | 
            <a href="http://www.tamtay.vn/mybookmark/all">Web hay</a> | 
            <a href="http://www.tamtay.vn/group">Nhóm</a> | 
            <a href="http://www.tamtay.vn/myttnetwork/home">Network</a> | 
            <a href="http://www.tamtay.vn/group/forum">Diễn đàn</a> | 
            <a href="http://raovat.tamtay.vn/">Rao vặt</a>
        </div>
		<?php if ($user->uid) {?>
        <div class="ttuser">Chào <strong><?php echo $user->name; ?></strong> - <a href="<?php echo IDS_LOGOUT_URL;?>">Thoát</a></div>
		<?php } else {?>
        <div class="navi" style="padding-top:0px">
			<a href="<?php echo IDS_LOGIN_URL;?>">Đăng nhập</a>&nbsp;
			<a href="<?php echo IDS_REGISTER_URL;?>">Đăng ký</a>
        </div>
		<?php }?>
    </div>
    <div style="width: 980px; margin: 10px auto 0pt; background: url(<?php echo $this->layout()->spath;?>/images/bottom.jpg) no-repeat scroll center bottom rgb(255, 255, 255); padding-bottom: 20px;">
        <!--Header:-->
        <div id="header" class="page-center" >
    	    <!--Banner:-->
            <div id="banner"></div>
            <!--Menu:-->
            <div id="menu">
        	    <ul class="menu-left">
                    <li><a href="/event/<?php echo $this->layout()->short_cut;?>" title="Trang chủ">Trang chủ</a></li>
                    <li><a href="/event/<?php echo $this->layout()->short_cut;?>#mark_news" title="Tin tức">Tin tức</a></li>
                    <?php for($i=0; $i<count($vote_list); $i++){
                	    $vote = $vote_list[$i];
                	    if($vote["votephoto_category"] > 0){
                	    ?>
                	    <li><a href="http://photo.tamtay.vn/category/browse/<?php echo $vote["votephoto_category"];?>" title="Tin tức"><?=$vote["name"];?></a></li>
                    <?php }else {?>
        		    <li><a href="/event/<?php echo $this->layout()->short_cut; ?>/votedlist/<?php echo $vote["thid"]."/".$vote["pid"];?>" title="Tin tức"><?=$vote["name"];?></a></li>
        		    <?php 
        			    } // End of if
        			    } ?>
                    <li><a href="/event/<?php echo $this->layout()->short_cut;?>#mark_video" title="Video">Video</a></li>
                    <!--<li><a href="#mark_" title="Thể lệ">Thể lệ cuộc thi</a></li>-->
                </ul>
            </div>
        </div>
        <!--End Header:-->
        <div class="clear"></div>   
        <div style="margin: 0pt auto; width: 960px;"> 
		    <?php echo $this->layout()->content;?>
		    <div class="clear"></div>
        </div>    
        <div class="clear"></div>
	</div>
	<!--Start: Bottom-->
	<div class="page-center" id="footer">
        <p class="copyright">Copyright by tamtay.vn</p>
        <p class="logo"><a title="www.tamtay.vn" href="http://www.tamtay.vn"><img src="<?php echo $this->layout()->spath;?>/images/logo-F.gif"></a></p>
    </div>
	<!--End: Bottom-->
</div>

</body>
</html>